package com.xcity.pomelo.response;

import com.xcity.db.entity.Player;
import com.xcity.game.common.PlayerPool;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class ActivityChipsCollectOperationResponse extends Response {
	
	public int state; // 拼图状态
	public int index; // 碎片位置
	public int id; // 碎片id
	public int count; // 碎片剩余数量
	public byte used; // 该碎片是否已使用
	
	public ActivityChipsCollectOperationResponse(int serial, Player player, int index, int chipId) {
		super(serial);
		this.state = player.getPool().getIntValue(PlayerPool.PROPERTY_CHIPS_COLLECT_STATE);
		this.index = index;
		this.id = chipId;
		this.count = player.getBag().countOf(chipId);
		this.used = (byte) (state >> index & 1);
	}

}
